//
//  HexMapGridLayer.h
//  DiceWar
//
//  Created by xiaofeng on 19/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#ifndef GAME_GAMEPLAY_HexMapGridLayer_H_
#define GAME_GAMEPLAY_HexMapGridLayer_H_

#include "cocos2d.h"
#include "HexMapGrid.h"
#include "Player.h"

class HexMapGridLayer : public cocos2d::CCLayer
{
public:
    LAYER_NODE_FUNC(HexMapGridLayer);
    
    HexMapGridLayer();
    ~HexMapGridLayer();
    
    bool init();
    
    /** set the display of the grid view based on the data stored in the mapGrid
     */
    void setDisplay(const HexMapGrid& mapGrid);
    
private:
    
    /** hide the grid for non-playable grid
     */
    void hide();
    
    
    /** set the corresponding cell sprite according to player type
     */
    void setCellSprite(const HexMapGrid& mapGrid);

    /** set the number of dices sprite
     */
    void setNumDicesSprite(const HexMapGrid& mapGrid);
    
    /** get the cell sprite path from the player type 
     */ 
    const char* getCellSpritePath(PlayerType playerType);
    
private:
    cocos2d::CCSprite* m_pCellSprite;
    cocos2d::CCLabelTTF* m_pNumDicesLabel;
};

#endif
